package com.hoolai.synroom.config;

import com.google.protobuf.GeneratedMessage;
import com.hoolai.synroom.config.CmdsConfig.CmdDomain;

public class ReqCmdProperties {
    private final String protoName;

    private final String serviceName;

    private final String methodName;

    private final CmdDomain cmdDomain;

    private final GeneratedMessage defaultInstance;
    
    private final int index;

    public ReqCmdProperties(String protoName, String serviceName, String methodName, GeneratedMessage proto,
            CmdDomain cmdDomain ,int index) {
        this.protoName = protoName;
        this.serviceName = serviceName;
        this.methodName = methodName;
        this.defaultInstance = proto;
        this.cmdDomain = cmdDomain;
        this.index = index;
    }

    public String getProtoName() {
        return protoName;
    }

    public String getServiceName() {
        return serviceName;
    }

    public String getMethodName() {
        return methodName;
    }

    public GeneratedMessage getDefaultInstance() {
        return defaultInstance;
    }

    public CmdDomain getCmdDomain() {
        return cmdDomain;
    }

    public boolean isGlobalCmd() {
        return cmdDomain == CmdDomain.global;
    }

    public boolean isSynRoomCmd() {
        return cmdDomain == CmdDomain.synRoom;
    }
    
    public boolean isDirectCmd() {
        return cmdDomain == CmdDomain.direct;
    }

    public int getIndex() {
        return index;
    }

}
